/*************************************************
Author: byron
Date: 10/25/2012
Description:
Notes: 
*************************************************/

#ifndef __cmdgm_h__
#define __cmdgm_h__

#include "../maindef.h"
#include "PBMsgHead.pb.h"
#include "MsgGM.pb.h"

class CMainCtrl;
class CPlayerBaseInfo;
class CPlayerDetailInfo;
class CPlayerOnlineData;
extern int gm_time_offset;
class CCmdGMPlayer : public CTAsyncCmd
{
public:
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);
    virtual int CallBack(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqGMPlayer stReq;
    MsgAnsGMPlayer stAns;

	char 			_chSubCmd;
    unsigned int 	_uiGID;

private:
	int GetInfoByGID(CPlayerBaseInfo& stPlayerBase,
            CPlayerDetailInfo& stPlayerDetail,
            CPlayerOnlineData& stPlayerOnline);
    int GetHelpInfo();
    int SendInnerReq();

};


class CCmdGMCreateUsers : public CTAsyncCmd
{
public:
    CCmdGMCreateUsers ()
    {
        _iMaxUserCount = 200;
        _szPrefixName [0] = '\0';
        _ucStage = 0;
        _uiGid = 0;
        _iHaveCreatedCount = 0;
    }

    virtual int Do(void* pData);    
    virtual int LogicDo(int iRet);
    virtual int CallBack(int iRet);

    int InitOnline (unsigned int uiGid);

    char   _szPrefixName[10];
private:
    int _iMaxUserCount;
    int _iHaveCreatedCount;    
    unsigned int  _uiGid;
    unsigned char _ucStage;
};

#endif // __cmdgm_h__

